using TMPro;
using UnityEngine;

public class SongEntryUI : MonoBehaviour
{
    public TextMeshProUGUI titleText;
    public TextMeshProUGUI artistText;
    public TextMeshProUGUI bpmText;
    public TextMeshProUGUI difficultyText;

    public void PopulateSongInfo(SongData songData)
    {
        if (titleText != null) titleText.text = songData.title;
        if (artistText != null) artistText.text = songData.artist;
        if (bpmText != null) bpmText.text = $"BPM: {songData.bpm}";

        if (difficultyText != null)
        {
            string difficulties = "";
            foreach (var level in songData.levels)
            {
                difficulties += $"{level.levelName}: {level.levelValue} ";
            }
            difficultyText.text = difficulties;
        }
    }
}